<script setup>
import { computed, ref, provide } from 'vue';
import MyTable from '@/components/MyTable/MyTable.vue';

const props = defineProps({
  // 表格数据总条数
  total: { type: Number, default: 0 },
  // 表格当前页码
  pageNum: { type: Number, default: 1 },
})
// 分页参数
const pagination = computed(() => ({
  total: props.total,
  showSizeChanger: false,
  current: props.pageNum,
  onChange: e => { emits('pageChange', e) }
}))

const emits = defineEmits(['edit', 'xq', 'pageChange', 'reload'])

// 表格列配置
const columns = ref([
  { ellipsis: true, title: '时间', dataIndex: 'statisticsDate', key: 'statisticsDate', },
  { ellipsis: true, title: '新增PC端用户', dataIndex: 'addNumPc', key: 'addNumPc', },
  { ellipsis: true, title: '新增小程序端用户', dataIndex: 'addNumApp', key: 'addNumApp', },
  { ellipsis: true, title: 'PC端用户日活量', dataIndex: 'dayLivePc', key: 'dayLivePc', },
  { ellipsis: true, title: '小程序端用户日活量', dataIndex: 'dayLiveApp', key: 'dayLiveApp', },
])
provide('columns', columns.value)
</script>

<template>
  <MyTable :pagination="pagination" :scroll="{ y: 'calc(100vh - 383px)' }">
  </MyTable>
</template>